package HealthCard.Helper;

import com.alibaba.fastjson.JSONObject;
import com.tencent.healthcard.impl.HealthCardServerImpl;
import com.tencent.healthcard.model.CommonIn;

import java.util.UUID;

public class InitHealthCardServerImpl {

    static String appSecret = "b1d1a14c50a6082e0508b514e75ea4b9";
    static String appToken = "";
    static String requestId = UUID.randomUUID().toString().replaceAll("-", "").toUpperCase();
    static String hospitalId = "30135";
    static String appId = "0c5a1410f36d8e4186a65d9163dbc933";
    //调用接口
//    string appToken2="";

    public static HealthCardServerImpl getHealthCard() {
        HealthCardServerImpl healthCard = new HealthCardServerImpl(appSecret);
        CommonIn commonIn = new CommonIn(appToken, requestId, hospitalId);
        JSONObject appTokenObj = healthCard.getAppToken(commonIn, appId);

        CommonIn commonIn2 = new CommonIn(appTokenObj.getJSONObject("rsp").getString("appToken"), requestId, hospitalId);


        return healthCard;
    }
}
